package mspbots.data.tl.prod.timedoctor.listener;

import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import mspbots.data.tl.entity.ResultMessageModel;
import mspbots.data.tl.prod.timedoctor.service.TimedoctorWorklogsService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Log4j2
@Service
@Component
@RequiredArgsConstructor
public class TimedoctorSyncListener {

    private final TimedoctorWorklogsService timedoctorWorklogsService;

    @RabbitListener(queues = "timedoctor.worklogs.tl")
    public void syncTimedoctorWorklogs(ResultMessageModel model) {
        timedoctorWorklogsService.sync(model);
    }
}
